FROM dockerliweipei/xdebug:php7.0


#用户
#USER www-data

#加文件
ENV VER DedeCMS-V5.7-UTF8-SP2
ENV GIT_ROOT  /var/www/html
ADD tools/${VER}.tar.gz ${GIT_ROOT}/
ENV WEB ${GIT_ROOT}/uploads
RUN ln -s ${GIT_ROOT}/${VER}/uploads ${WEB}

#权限
#RUN chown -R www-data ${WEB}
WORKDIR ${WEB}

#RUN chmod -R 777 ${APACHE_DOCUMENT_ROOT}/Runtime

#w配置
RUN ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
WORKDIR /etc/apache2/sites-enabled/
RUN sed -i "s#DocumentRoot /var/www/html/public#DocumentRoot ${WEB}#" 000-default.conf

#git
WORKDIR ${GIT_ROOT}
RUN rm -rf .git
ENV GIT=https://code.aliyun.com/liweipei/dedecms.git
RUN git init
RUN git remote add origin ${GIT}



EXPOSE 80
#CMD /etc/init.d/apache2 start